<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="../dist/pear-downloader.js"></script>
<body>
    <pr-downloader id="downloader"
                   data-src="https://qq.webrtc.win/tv/Pear-Demo-Yosemite_National_Park.mp4">
    </pr-downloader>
</body>
<script>
    var PRDownloader = document.getElementById('downloader');

    PRDownloader.instance.on('begin', function () {
        console.warn('6666666666');
        console.warn(PRDownloader.instance);
    });
    PRDownloader.instance.on('done', function () {
        console.warn('finished downloading buffer by first aid');
    });
    PRDownloader.instance.on('sourcemap', onSourceMap);
    function onSourceMap(sourceType, index) {
        console.warn('Received source type:' + sourceType + ' index:' + index);
    }
</script>
</html>